package com.ithema.text;

import java.util.Random;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
    Scanner cs= new Scanner(System.in);
        System.out.println("请输入字符串：");
        String s = cs.nextLine();
        String[] split1 = s.split("-");
        for (int i = 0; i < split1.length; i++) {
            String s1 = split1[i];
            System.out.println(s1);

        }

        String str = getStr();
        System.out.println(str);

    }
    public static String getStr(){
                    Random r=new Random();
                    StringBuilder sb=new StringBuilder();
                    for (int i = 1; i <=5 ; i++) {
                        if(i==1){
                            //i1 = r.nextInt(10);
                sb.append(r.nextInt(10));
            }else {
                sb.append((char)(r.nextInt(26) + 65));
            }

        }
        return sb.toString();
    }
}
